//
//  GetDeviceListRequest.m
//  TestGizWits
//
//  Created by JM on 15/11/18.
//  Copyright © 2015年 JM. All rights reserved.
//

#import "GetDeviceListRequest.h"

@implementation GetDeviceListRequest
- (void)didRealRequest {
    //需要开发者自行把 uid 和 token 换成实际的值
    [[XPGWifiSDK sharedInstance] getBoundDevicesWithUid:self.DY_uid token:self.DY_token specialProductKeys:nil];
}

//搜索设备
- (void)XPGWifiSDK:(XPGWifiSDK *)wifiSDK didDiscovered:(NSArray *)deviceList result:(int)result {
    if(result == XPGWifiError_NONE) {
        GetDeviceListResponse* response = [GetDeviceListResponse response];
        response.DY_wifiSDK = wifiSDK;
        response.DY_deviceList  = deviceList;//XPGWifiDevice
        self.block(response,nil);
    }
    else
    {
        self.block(nil,[NSError dy_errorWithErrCode:result]);
    }
    [super superHandelResponse];
  
}

@end

@implementation GetDeviceListResponse

@end
